<template>
  <view class="homeIndex">
    <u-cell-group title="功能">
      <u-cell-item
        icon="integral-fill"
        title="待办"
        @tap="target('/subPages/todo/todo')"
      ></u-cell-item>
      <u-cell-item
        icon="integral-fill"
        title="笔记"
        @tap="target('/subPages/note/note')"
      ></u-cell-item>
      <u-cell-item
        icon="integral-fill"
        title="测试"
        @tap="target('/subPages/test/test')"
      ></u-cell-item>
    </u-cell-group>
    <u-cell-group title="支撑功能">
      <u-cell-item
        icon="integral-fill"
        title="分类"
        @tap="target('/subPages/classification/classification')"
      ></u-cell-item>
    </u-cell-group>
  </view>
</template>

<script>
let vk = uni.vk;
export default {
  data() {
    return {
      scrollTop: 0,
    };
  },
  onPageScroll(e) {
    this.scrollTop = e.scrollTop;
  },
  // 监听 - 页面每次【加载时】执行(如：前进)
  onLoad(options = {}) {
    vk = uni.vk;
    this.options = options;
    this.init(options);
  },
  // 监听 - 页面【首次渲染完成时】执行。注意如果渲染速度快，会在页面进入动画完成前触发
  onReady() {},
  // 监听 - 页面每次【显示时】执行(如：前进和返回) (页面每次出现在屏幕上都触发，包括从下级页面点返回露出当前页面)
  onShow() {},
  // 监听 - 页面每次【隐藏时】执行(如：返回)
  onHide() {},
  // 监听 - 点击右上角转发时
  onShareAppMessage(options) {},
  // 函数
  methods: {
    init(options) {
      vk.pubfn.checkLogin();
    },
    target(url) {
      vk.navigateTo(url);
    },
  },
};
</script>
<style lang="scss" scoped>
.homeIndex {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--window-bottom) - var(--window-top));
}
</style>
